package net.easyjava.base.utils.http.juhe.bean;

import net.easyjava.base.utils.http.juhe.constants.JuheConstants;
import net.easyjava.tools.BaseBean;

/**
 * Created by wenxiaoning on 16/1/29.
 */
public class ResultBean extends BaseBean {
    private static final long serialVersionUID = 7961706942236463657L;
    private int error_code;//标识码
    private String reason;//信息
    private String result;//结果

    public ResultBean() {
    }

    public ResultBean(String reason) {
        this.reason = reason;
        this.error_code = -1;
    }

    /**
     * 判断是否成功
     * @return
     */
    public boolean isSuccess(){
        return this.error_code == JuheConstants.CODE_SUCCESS;
    }

    /**
     * 判断是否失败
     * @return
     */
    public boolean isError(){
        return !isSuccess();
    }

    public int getError_code() {
        return error_code;
    }

    public void setError_code(int error_code) {
        this.error_code = error_code;
    }

    public String getReason() {
        return reason;
    }

    public void setReason(String reason) {
        this.reason = reason;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }
}
